import { useState } from "react"

interface ToolModelData {
  cameraParams: any[]
  imageJointParams: any[]
  robotParams: any[]
}

export default function toolModel() {
  const initData: ToolModelData = {
    cameraParams: [],
    imageJointParams: [],
    robotParams: []
  }

  const [toolData, setToolData] = useState<ToolModelData>(initData)

  const updateToolData = (newData: Partial<ToolModelData>) => {
    setToolData((prevData) => ({ ...prevData, ...newData }))
  }

  return {
    ...toolData,
    updateToolData
  }
}
